<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table cellspacing="0" border="0" width="995">
	<tr>
		<td width="995" class="title_manager_product">Quản lý download</td>
	</tr>
	<tr>
		<td height="90">
			<table border="0" cellpadding="0" cellspacing="0" width="995">
				<tr>
					<td align="center">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="center"><img src="images/CreateNews.gif" width="48" height="47" border="0" /></td>
							</tr>
							<tr>
								<td align="center" class="title_new_add"><a href="index.php?admin=downloadAdmin&do=formadddownloadcategory">Tạo danh mục download</a></td>
							</tr>
						</table>
						
					</td>
					
					<td align="center">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="center"><img src="images/CreateCategory.gif" width="51" height="48" border="0" /></td>
							</tr>
							<tr>
								<td align="center" class="title_new_add"><a href="index.php?admin=downloadAdmin&do=formaddfile">Thêm tài liệu download</a></td>
							</tr>
						</table>
						
					</td>
					
				</tr>
			</table>
		</td>	
	</tr>
</table>
<table cellspacing="0" border="0" width="995">
	<tr>
		<td width="200" valign="top">					
			<?php
				include("menuleftdownload.php");
			?>
		</td>	
		<td width="790" valign="top">
			<table cellspacing="0" border="0" width="790">
				<tr>
				<?php
					$id=$_GET['id'];
					
					$querycat="SELECT * FROM productdownloadcategories WHERE id=$id";
					$resultcat=mysql_query($querycat) or die(mysql_error());
					while($rowscat = mysql_fetch_array($resultcat)){?>
						<td width="790" class="title_manager_cate"><?php echo $rowscat['titleDownload'];?></td>
				<?php
				}
				?>	
				</tr>
			</table>
			
			<table cellspacing="0" cellpadding="0" border="0" width="790">
						<tr>
							<td>
								<table class="reference" cellspacing="0" cellpadding="0" border="0" width="790">
									<tr>
										<td width="10" class="listgrouptitle"><b>ID</b></td>
										<td width="550" class="listgrouptitle"><b>Tên tài liệu</b></td>
										
										<td width="150" class="listgrouptitle"><b>Download</b></td>
										<td width="80" class="listgrouptitle"><b>Chức năng</b></td>
									</tr>
									
										<?php
											$id=$_GET['id'];
											$query="SELECT * FROM productdownloads WHERE cateID=$id";
											$result=mysql_query($query) or die(mysql_error());
											while($rows=mysql_fetch_array($result)){?>
											<tr>
												<td><?php echo $rows['id'];?></td>
												<td><?php echo $rows['filename'];?></td>
												
												<td><?php echo $rows['download']?></td>
												<td align="center">
													<a href="index.php?admin=downloadAdmin&do=formeditfile&id=<?php echo $rows['id'];?>" title="Sửa"><img src="images/edit.gif" width="17" height="17" border="0" /></a>
													<a href="index.php?admin=downloadAdmin&do=deletefile&id=<?php echo $rows['id'];?>" onclick="return confirm('Bạn có muốn xoá file này không?');" title="Xóa"><img src="images/delete.gif" width="17" height="17" border="0" /></a>                        
												</td> 
											</tr>
										<?php
										}
										?>    
									
								</table>
							</td>
						</tr>
					
			</table>
		</td>
	</tr>	
</table>
</body>
</html>
